package exercise;

import java.util.Scanner;

public class exercise_5 {
	static boolean leapYear(int n) {
			if((n%4==0&&n%100!=0)||n%400==0) {
				return true;
			}
			return false;
	}
	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		int year = in.nextInt();
		//1600 5 1 Monday
		int days = 0;
		for(int i =1601;i<=year;i++) {
			if(leapYear(i)) {
				days += 366;
			} else {
				days += 365;
			}
		}
		int mod = days%7;
		String str;
		int daynum;
		daynum = 14 - mod;
		System.out.println(daynum);

	}

}
